<#assign ctx = request.contextPath />
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		 <meta name="viewport" content="width=device-width, initial-scale=1 ,minimum-scale=1.0 ,maximum-scale=1.0" user-scalable=no>
		<title>服务人员信息</title>
	</head>
	
	<script src="${ctx}/assets/js/jquery-1.11.0.min.js" type="text/javascript"></script>
	
	<style>
	body, div, dl, h1, h2, h3, h4, h5, h6, form, p, span, button {
		padding:0;
		margin:0;
	}
	body {
		background-color:#f0f3f7;
		}
	.content {
		margin:15px;
	}
	.c-list {
		border-bottom:1px sliod #000;
	}
	.content dt {
		float:left;
		margin-right:15px;
		}
	.content dd h1 {
		color:#454545;
		font-size:24px;
		padding-bottom:4px;
		}
	.content dd p {
		color:#686868;
		line-height:22px;
		}
	.content dd p span {
		width:145px;
		display:inline-block;
		}
	.c-l-btn {
		margin-top:10px;
	}
	.c-l-btn a {
		color:#fff;
		width:98%;
		height:36px;
		line-height:36px;
		font-size:18px;
		border:none;
		display:block;
		text-align:center;
		border-radius:3px;
		background-color:#0ab031;
		text-decoration: none;
	}
	.c-list {
		padding-bottom:20px;
		border-bottom:1px solid #dee1e5;
	}
		
	</style>
	
	<body>
		<div class="content">
			<form id="weixin_form" action="${ctx}/wx/v1/weixinOrder" method="post">
				<input type="hidden" name="clientLatitude" value="${lat}">
				<input type="hidden" name="clientLongitude" value="${lng}">
				<input type="hidden" name="fromPlace" value="${label?if_exists}">
				<input type="hidden" name="t" value="${t}">
				<input type="hidden" name="driverId" value="${driver.id}">
				<#if bind?? && bind.status==1>
				<input type="hidden" name="clientPhone" value="${bind.phone}">
				</#if>
				
				<div class="c-list">
			        <dl>
			            <dt><img width="120" height="120" <#if driver.photo??>src="${ctx}/upload/driver/${driver.photo}"<#else>src="${ctx}/assets/css/images/list_bg.png"</#if>></dt>
			            <dd>
			                <h1>${driver.name?if_exists}</h1>
			                <p><span>年龄 : ${driver.age?if_exists}岁</span><span>代驾次数 : ${driver.driveTimes}次</span></p>
			                <p><span>驾龄 : ${driver.jialing}年</span><span>距您 : ${distanceStr?if_exists}</span></p>
			            </dd>
			        </dl>
			        <#if bind?? && bind.status==1>
			        	<div class="c-l-btn" id="weixin_order"><a href="javascript:;">立即下单</a></div>
			        <#else>
			        	<div class="c-l-btn"><a href="tel:${phone?if_exists}">拨打电话</a></div>
			        </#if>
			    </div>
		    </form>
		</div>
	</body>
	
	<script type="text/javascript">
		$(document).ready(function(){
			$("#weixin_order").click(function(){
				if(!$(this).find("a").attr("disabled")){
					var r=confirm("确认立即下单吗？")
	  				if (r==true){
	  					$("#weixin_order a").attr("disabled",true);
	  					$.post($("#weixin_form").attr("action"),$("#weixin_form").serialize(),function(result){
							if(result.success){
								alert("下单成功，即将为您服务！");
							}
							else{
								alert(result.message);
							}
							$("#weixin_order a").attr("disabled",false);
						});
	  				}
				}
			});
		});
	</script>
</html>
